import Layout from '@/layout'
//静态权限
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard'),
      meta: { title: '首页', icon: 'dashboard' }
    }]
  },
  // 权限管理
  {
    path: "/acl",
    name: 'Acl',
    component: Layout,
    meta: {
      title: '权限管理',
      icon: 'el-icon-lock'
    },
    children: [

      {
        path: "role",
        name: "Role",
        component: () => import("@/views/acl/role"),
        meta: {
          title: "角色管理",
        },
      }, 
      {
        name:'RoleTo',
        path:'role/roleTo',
        hidden:true,
        component:()=>import('@/views/acl/role/roleTo.vue'),
        meta:{
          title:'权限配置管理',
        },
      },
      {
        path: "user",
        name: "User",
        component: () => import("@/views/acl/user"),
        meta: {
          title: "用户管理",
        },
      },
      {
        path: "permission",
        name: "Permission",
        component: () => import("@/views/acl/permission"),
        meta: {
          title: "菜单管理",
        },
      }
    ],
  },
  // 商品管理
  {
    name: 'Product',
    path: '/product',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '商品管理',
      icon: 'el-icon-goods',
    },
    children: [
      {
        name: 'trademark',
        path: 'trademark/list',
        component: () => import('@/views/product/trademark'),
        meta: {
          title: '品牌管理'
        }
      },
      {
        name: 'Attr',
        path: 'attr/list',
        component: () => import('@/views/product/attr'),
        meta: {
          title: '平台属性管理'
        }
      },
      {
        name: 'Sku',
        path: '/sku/list',
        component: () => import('@/views/product/sku/index.vue'),
        meta: {
          title: 'sku管理'
        }
      },
      {
        name: 'Spu',
        path: '/Spu/list',
        component: () => import('@/views/product/spu/index.vue'),
        meta: {
          title: 'spu管理'
        }
      },
    ]
  },
]
// 任意权限
export const anyRoutes = [
  { path: '*', redirect: '/404', hidden: true }
]
//动态权限
